//
//  NKBabyInfoController.m
//  NiKi
//
//  Created by qiang chen on 16/6/25.
//  Copyright © 2016年 qiang chen. All rights reserved.
//

#import "NKBabyInfoController.h"

@interface NKBabyInfoController (){
    
    __weak IBOutlet UITextField *_nameTf;

    __weak IBOutlet UIButton *_choseBirthDayBtn;
    __weak IBOutlet UIButton *_boyBtn;
    __weak IBOutlet UIButton *_girlBtn;
    UIButton *_selectedBtn;
    IBOutlet UIView *_choseBabyBirthDayV;
    __weak IBOutlet UIDatePicker *_datePicker;
}

@end

@implementation NKBabyInfoController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.layer.contents = (id)[UIImage imageNamed:@"背景底图"].CGImage;
    _boyBtn.selected = YES;
    _selectedBtn = _boyBtn;
    [_nameTf setValue:@(10) forKey:@"padding"];
}

- (IBAction)choseBirthDayBtnClick:(UIButton *)sender {
    _choseBabyBirthDayV.frame = CGRectMake(0, 0, ScreenW, ScreenH);
    [self.view addSubview:_choseBabyBirthDayV];
}


- (IBAction)cancleBtnClick:(UIButton *)sender {
    [_choseBabyBirthDayV removeFromSuperview];
}

- (IBAction)okBtnClick:(UIButton *)sender {
    [_choseBabyBirthDayV removeFromSuperview];
}

- (IBAction)sexBtnClick:(UIButton *)sender {
    sender.selected = YES;
    if (sender == _boyBtn) {
        _girlBtn.selected = NO;
    }else{
        _boyBtn.selected = NO;
    }
    _selectedBtn = sender;
    
    CAKeyframeAnimation *anim = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"];
    anim.duration = 0.5;
    anim.keyTimes = @[@(0),@(0.3),@(0.5),@(0.7),@(1)];
    anim.values = @[
                    [NSValue valueWithCGPoint:CGPointMake(1, 1)],
                    [NSValue valueWithCGPoint:CGPointMake(1.4, 1.4)],
                    [NSValue valueWithCGPoint:CGPointMake(1.5, 1.5)],
                    [NSValue valueWithCGPoint:CGPointMake(1.4, 1.4)],
                    [NSValue valueWithCGPoint:CGPointMake(1, 1)]
                    ];
    [sender.layer addAnimation:anim forKey:nil];
}

- (UIStatusBarStyle)preferredStatusBarStyle {
    return UIStatusBarStyleLightContent;
}
@end
